<?php
	require '../utils/conn.php';
	include_once '../models/recommand.php';
	
	$title = $_REQUEST['title'];
	$status = $_REQUEST['status'];
	
	$recommand = new Recommand();
	$recommand->setTitle($title);
	$recommand->setStatus($status);
	$recommand->setTimestamp(time());
	$query = "INSERT INTO t_recommand(r_title, r_status, r_timestamp)" . " VALUES('$recommand->title','$recommand->status','$recommand->timestamp')";
	echo $query;
	$result = mysql_query($query) or die("insert set failed：". mysql_error());
	$recommand->recommandId = mysql_insert_id();
	echo $recommand->recommandId;
?>